//
//  WWMiddleButton.m
//  Shopping
//
//  Created by 张世敏 on 16/8/20.
//  Copyright © 2016年 张湾湾. All rights reserved.
//

#import "WWMiddleButton.h"

@implementation WWMiddleButton

- (instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        
    }
    return self;
}

#pragma mark - 布局 -

-(void)layoutSubviews {
    [super layoutSubviews];
    
    CGFloat midX = self.frame.size.width / 2;
    CGFloat midY = self.frame.size.height/ 2 ;
    self.titleLabel.center = CGPointMake(midX, midY + 20.5);
    self.imageView.center = CGPointMake(midX, midY - 10);
    self.imageView.bounds = CGRectMake(0, 0, 50, 50);
    CGRect frame = self.imageView.frame;
    frame.origin.y = 1;
    self.imageView.frame = frame;
    
    self.imageView.contentMode = UIViewContentModeScaleAspectFit;
    self.titleLabel.bounds = CGRectMake(0, 0, 50, 30);
    self.titleLabel.textAlignment = NSTextAlignmentCenter;
    
    self.titleLabel.font = [UIFont systemFontOfSize:12];
}

@end
